using System.Collections.Generic;
using UnityEngine;

/*
游戏类基类
*/

public abstract class GameBase : MonoBehaviour
{   
    [Tooltip("玩家")]
    public Player player;
    [Tooltip("敌人")]
    public List<Enemy> enemyList;
    [Tooltip("游戏管理器")]
    public GameManager gameManager;

    public abstract void OnAwake();
    public abstract void Process(int Node);
    
    protected void Next(){
        gameManager.Next();
    }

    protected void Info(string info){
        gameManager.stateInfo = info;
    }

    private void Awake() {
        gameManager = GameManager.instance;
        gameManager.game = this;
        gameManager.OnProcess.AddListener(Process);
        OnAwake();
    }

    private void Update() {
        if(player == null){
            player = FindAnyObjectByType<Player>();
        }
    }

}
